<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('车辆材料采购审批')" />
    <link rel="stylesheet" href="../../../../../../../../../../../../css/navigation.css">
</head>
<body class="gray-bg">
<div class="navigation visible-xs-block">
    <ol class="breadcrumb">
        <span> > </span>
        <li><a href="#" onclick="gomain()">主页</a></li>
        <li style="color: black">车辆材料采购审批</li>
    </ol>
    <div class="aLine"></div>
</div>
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <div id="container" style="height: 500%"></div>
                        <ul>
                            <li>
                                <label>车牌号：</label>
                                <input type="text" name="cCarld"/>
                            </li>
                            <li class="select-time">
                                <label>登记时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCTime]"/>
                            </li>
<!--                            <li>-->
<!--                                <label>备注：</label>-->
<!--                                <input type="text" name="cRemark"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>金额：</label>-->
<!--                                <input type="text" name="cMoney"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>上传文件：</label>-->
<!--                                <input type="text" name="cData"/>-->
<!--                            </li>-->
                        <li>
                            <label>审批状态：</label>
                            <select name="cStatus" th:with="type=${@dict.getType('car_up')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                                </option>
                            </select>
                        </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="ruoyi:repairlead:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="ruoyi:repairlead:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>

        </div>
    </div>

    <th:block th:include="include :: footer" />
    <script src="../../../../../../../../../../../../js/breadcrumb.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat/dist/ecStat.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/dataTool.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/china.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/world.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/bmap.min.js"></script>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('ruoyi:repairlead:edit')}]];
        var removeFlag = [[${@permission.hasPermi('ruoyi:repairlead:remove')}]];
        var prefix = ctx + "ruoyi/repairlead";
        var eStatus = [[${@dict.getType('car_up')}]];
        $(function() {
            var options = {
                url: prefix + "/list",
                updateUrl: prefix + "/edit/{id}",
                exportUrl: prefix + "/export",
                showColumns: false,
                sortName:'cTime',
                sortOrder: 'desc',
                modalName: "车辆材料采购审批列表",
                columns: [
                {
                    field: 'cId', 
                    title: '记录id',
                    visible: false
                },
                {
                    field: 'cCarld', 
                    title: '车牌号'
                },

                    {
                        field: 'cDepa',
                        title: '申请人部门'
                    },
                    {
                        field: 'cPeople',
                        title: '申请人'
                    },
                    {
                        field: 'cPicture',
                        title: '申请人头像',
                        align: 'center',
                        formatter: function(value, row, index) {
                            return $.table.imageView(value);
                        }
                    },
                    {
                        field: 'cRemark',
                        title: '备注'
                    },
                    {
                        field: 'cTime',
                        title: '维修时间',
                        sortable: true
                    },

                {
                    field: 'cData', 
                    title: '文件下载',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return '<a href="javascript:downloadFile(\''+row.cData+'\')">下载</a>';
                    }
                },
                {
                     field: 'cStatus',
                     title: '审批状态',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(eStatus, value);
                    }
                },
                    {
                        field: 'cText',
                        title: '审批意见'
                    },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if (row.cStatus ==1){
                            actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="consent(\'' + row.cId + '\')"><i class="fa fa-user"></i> 通过</a> ');
                            actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.cId + '\')"><i class="fa fa-edit"></i>驳回</a> ');                        }

                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        function downloadFile(cData) {
            window.location.href=ctx+"common/download/resource?resource="+cData;
        }
        function consent(cId) {
            $.modal.confirm("确认要通过申请吗?", function() {
                var url = prefix + "/consent";
                var data = { "id": cId };
                $.operate.submit(url, "post", "json", data);
            });
        }


    </script>
</body>
</html>